//
// Created by glt on 2025/3/14.
//
#include <iostream>
#include "TimeUtil.h"

int main() {

    int duration_in_second =get_timestamp_for_second();
    std::cout << duration_in_second << "秒" << std::endl;

    std::cout << "get_time:" << get_time()<< std::endl;

    auto time_now = std::chrono::system_clock::now();

    auto duration_in_ms = std::chrono::duration_cast<std::chrono::milliseconds>(
            time_now.time_since_epoch());
    std::cout << duration_in_ms.count() << "毫秒" << std::endl;

    auto duration_in_micro =
            std::chrono::duration_cast<std::chrono::microseconds>(
                    time_now.time_since_epoch());
    std::cout << duration_in_micro.count() << "微秒" << std::endl;

    long distance = 30*60;
    std::cout << "format_with_milliseconds:2" << format_with_milliseconds(duration_in_ms.count()-distance*1000)
              << std::endl;

    std::cout << "format_with_second:" << format_with_second(duration_in_second-distance)
              << std::endl;

    return 0;
}
